feat!: migrate to document-schema.js 4.0.0 (formatVersion retired, depth-only list memberships) - #65
Merged
Merged
Conversation
…pth-only list memberships) document-schema.js 4.0.0 retired ContentDocument's per-arm formatVersion literal -- versioning now lives at the serialised-artefact boundary via the release-pinned $schema URI -- so lowerParsedMarkdown no longer stamps one, and every fixture asserting the old envelope shape drops the field with it. The z.codec() pair validates both directions against ContentDocumentSchema itself, so the round-trip and conformance suites carry the new shape automatically. The jump from 3.2.0 also crosses 3.3.0's numId-optional ContentListMembership, which surfaces in emitMarkdown: a depth-only membership (a source carrying a level but no numbering identity of its own, e.g. OOXML drawing paragraphs' a:pPr/@lvl) renders under the same md/list-numid-fallback cross-format contract as a foreign numId -- a plain, tight, non-task bullet at the paragraph's own level, reported once per document. BREAKING CHANGE: readMarkdown's emitted ContentDocuments no longer carry formatVersion and validate against document-schema.js 4; consumers still validating against schema 3 must move to 4.
This was referenced Aug 18, 2026
Contributor
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves markdown-codec onto document-schema.js ^4.0.0, the tree-form major from ExaDev/document-schema.js#20.
Schema 4.0.0 retired ContentDocument's per-arm
formatVersionliteral (versioning now lives at the serialised-artefact boundary via the release-pinned$schemaURI), solowerParsedMarkdownno longer stamps one, and the test fixtures plus the smoke suite's spreadsheet fixture drop the field with it. Thez.codec()pair validates both directions againstContentDocumentSchemaitself, so the round-trip and conformance suites carry the new shape automatically -- green locally across lint, typecheck, build, the unit suite (940 tests incl. CommonMark/GFM conformance), workers, and smoke.The jump from 3.2.0 also crosses 3.3.0's numId-optional
ContentListMembership, which surfaced as three type errors inemit.ts: a depth-only membership (a source carrying a level but no numbering identity of its own -- OOXML drawing paragraphs'a:pPr/@lvlis the motivating case) can now reachemitMarkdown. It renders under the samemd/list-numid-fallbackcross-format contract as a foreign numId: a plain, tight, non-task bullet at the paragraph's own level, reported once per document. The README gotcha entry andsrc/shared/list-id.ts's contract note now cover both cases.No
Layout*imports existed outsideLayoutMetadata(which stays in the schema), so the layout demotion half of the major needed nothing here. Deliberately no tree-formDocumentPackagehandling either -- that lives behind documents.js's package boundary, not in a codec exchanging flatContentDocuments.Breaking for consumers:
readMarkdown's emitted ContentDocuments no longer carryformatVersionand validate against document-schema.js 4; consumers still validating against schema 3 must move to 4. semantic-release cuts this as 3.0.0.Generated by Claude Code